<?php
	include 'source/soap.fnc.php';
	include 'source/config.php';
?>

<!DOCTYPE html>
<html>
<head>
<title>浙江联通淘号吧-DIY号码列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link href="css/unicom.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- content 320 -->
<div class="uni_content">
		<!-- header 100% -->
		<div class="header">
			<img src="images/banner_02.jpg" alt="logo" class="logo_style">
			<a href="javascript:history.back();"><div class="header_divA"></div></a>
		</div>
			<!-- content -->
			<div class="content1" id="list_ul_li">
				<ul class="button_yuan">
					<li class="ul_li border_null" onClick="show_add()"><span class="clearfix" ><span class="font_style1">城市&nbsp;&nbsp;</span><span class="font_size1 font_color1" id="showshow"></span></span></li>
					<li class="ul_li" style="display:none;">
						<div class="div_margin">
							<span class="clearfix2 font_size1 address_style" id="showshow0" onClick="check_show(this.id);">杭州</span>
							<span class="clearfix2 font_size1 address_style" id="showshow1" onClick="check_show(this.id)">温州</span>
							<span class="clearfix2 font_size1 address_style" id="showshow2" onClick="check_show(this.id)">衢州</span>
							<span class="clearfix2 font_size1 address_style" id="showshow3" onClick="check_show(this.id)">浙江</span>
							<span class="clearfix2 font_size1 address_style" id="showshow4" onClick="check_show(this.id)">湖州</span>
							<span class="clearfix2 font_size1" id="showshow5" onClick="check_show(this.id)">嘉兴</span>
						</div>
					</li>
					<li class="ul_li border_null" style="display:none;">
						<div class="div_margin">
							<span class="clearfix2 font_size1 address_style" id="showshow6" onClick="check_show(this.id)">绍兴</span>
							<span class="clearfix2 font_size1 address_style" id="showshow7" onClick="check_show(this.id)">丽水</span>
							<span class="clearfix2 font_size1 address_style" id="showshow8" onClick="check_show(this.id)">金华</span>
							<span class="clearfix2 font_size1 address_style" id="showshow9" onClick="check_show(this.id)">台州</span>
							<span class="clearfix2 font_size1 address_style" id="showshow10" onClick="check_show(this.id)">舟山</span>
							<span class="clearfix2 font_size1" id="showshow11" onClick="check_show(this.id)">宁波</span>
						</div>
					</li>
				</ul>
			</div>

			<!-- lovers logo -->

			<?php if($type==3){?>
	<div class="content1">
		<div class="hotArea">
			<img src="images/icons_76.png" alt="情侣" class="hotImg"><span class="btn_f1 lovers_f1">爱我，就选择我吧！</span>
		</div>
	</div>
<?php } ?>
			<!-- content -->
			<div class="content2" id="phone_list">
				<p class="diy_p1">
					<?php if($type==1){?><img src="images/icons_03.png" alt="DIY号码" class="hotImg"><span class="btn_f1 diy_f1">DIY号码</span><?php } ?>
					<?php if($type==4){?><img src="images/icons_09.png" alt="吉祥财富号" class="hotImg"><span class="btn_f1 lucky_f1">吉祥财富号</span>&nbsp;&nbsp;<span id='luckyNumId'>尾号 168</span><?php } ?>
					
					</p>
				
			</div>
			<!-- footer -->
			<div class="content2">
				<div class="footer_div">
					<div class="button_yuan tl_button2" onClick="goto_pre();"><span>上一页</span></div>
					<div class="button_yuan tr_button2" onClick="goto_next();"><span>下一页</span></div>
				</div>
				<br/>
			</div>
<!-- 导航栏 -->
	<div class="AllNav">
		<div class="borRig" id="navBtn" onClick="funNav();">
			<img src="images/icons_19.png" class="navBtnImg">
		</div>
		<div class="borRig2">
			<ul class="button_yuan">
				<li class="Nav_li" onClick="window.open('phone_list.php?uid=1&domain=.&appkey=dm&type=0&ab=0','_self');"><img src="images/icons_03.png" alt="自制" class="NavImg1"><span class="diy_f1">DIY号码</span></li>
				<li class="Nav_li" onClick="window.open('hotnum.php?uid=1&domain=.&appkey=dm&type=4','_self');"><img src="images/icons_05.png" alt="热销" class="NavImg2"><span class="hot_f1">热销靓号</span></li>
				<li class="Nav_li" onClick="window.open('phone_list.php?uid=1&domain=.&appkey=dm&type=6&ab=0','_self');"><img src="images/icons_07.png" alt="情侣" class="NavImg3"><span class="lovers_f1">情侣号</span></li>
				<li class="Nav_li2" onClick="window.open('luckynum.php?uid=1&domain=.&appkey=dm&type=7','_self');"><img src="images/icons_09.png" alt="吉祥" class="NavImg4"><span class="lucky_f1">吉祥财富号</span></li>
			</ul>
		</div>
	</div>
<!-- 导航栏 -->
<div class="allBottoms">
			&nbsp;
		</div>
	</div>
	<!-- 所有页面导航 -->
		<div class="footNav">
		<div class="footNav-s">
			<div class="footNav-div1">
				<div class="footNav-div1-d">
					<img src="images/qietu_36.png" class="footNav-div1-img"/>
				</div>
			</div>
			<div class="footNav-div2">
				<div style="overflow:auto;">
				<!-- 左浮动 -->
				<a href="shoujiguan.php?uid=1&domain=.&appkey=dm">
				<div class="footNav-div2-dl">
					<div class="footNav-div2-dld">手机馆</div>
				</div>
				</a>
				<!-- 右浮动 -->
				<a href="javascript:void(0)">
				<div class="footNav-div2-dr">
					<div class="footNav-div2-drd">关注微信</div>
				</div>
				</a>
				<!-- 居中 -->
				<a href="shop.php?uid=1&domain=.&appkey=dm">
				<div class="footNav-div2-dm">
					<div class="footNav-div2-dmd">淘号吧</div>
				</div>
				</a>
				</div>
				<div class="LTDivLine"></div>
				<div class="unicomQQ">
					联通QQ:1031665132
				</div>
			</div>
			</div>
		</div>
<!-- 遮罩层或隐藏层 -->
	<div id="navWX-b" class="navWX-b"></div>
	<!-- 弹出层 -->
	<div id="navWX-w" class="navWX-w">
		<div class="navWX-wD">
			<div class="navWX-wD-d1">
				<img src="images/qietu_25.jpg" class="navWX-wD-d1-img">
			</div>
			<div class="navWXAdF">1，您可以扫上面的二维码 </div>
			<div class="navWXAdF">2，您也可以在微信内搜索"浙江联通网上商城"微信公众号，关注浙江联通微信，体验更多互动功能 </div>
		</div>
		<div class="navBtnQ">取消</div>
	</div>
</body>
</html>


            <script type="text/javascript" src="js/jquery-1.9.1.min.js" ></script>

            <script type="text/javascript" src="js/unicom.js" ></script>
            

            <script type="text/javascript" src="js/area.js" ></script>
<script language="javascript"> 
var g_page = 1;//页码
var g_next = true;//是否有下页
var input_areaid = areas[<?php echo $areaid;?>][0];
var input_type = <?php echo $type;?>;
var input_num = "";
var _index = <?php echo $areaid;?>;
	   <?php

	   if($type == 1){

	   ?>
	 
	   
	    input_num = '<?php echo $num;?>';

 <?php

} else if($type == 2){

?>
 input_num = '<?php echo $ruleCode;?>';
<?php

}else if($type == 4){
?>
	 input_num = '<?php echo $num;?>';  
<?php
}
?>
	   check_show1("showshow"+<?php echo $areaid;?>);
	  
	   //get_list();
	   
	   


//获取靓号列表
function get_list()
{
	var ab = 0;

	$.getJSON("ajax/get_list.php",{type:input_type,areaId:input_areaid,page:g_page,num:input_num},
	function (json){
		if(json.err == "1")
		{
			Uconfirm(json.errinfo);
			return false;
		}
		else
		{
			if(json.list.length == 0)
			{
				g_next = false;
				$("#phone_list p").eq(0).nextAll().remove();//清空表格
				return false;
			}
			if(json.list.length < 5)
			{
				g_next = false;
			}
			else
			{
				g_next = true;
			}
			$("#phone_list p").eq(0).nextAll().remove();//清空表格
			for(var i in json.list)
			{

				if(input_type==3){//情侣
					var str = "";
					str += "<div class='button_yuan button_margin' onclick=choose_phone("+json.list[i].phone_code+","+json.list[i].phone_code2+",'"+json.list[i].area_code+"')>";
					str += "<div class='fontcol_left'>"+json.list[i].phone_code+"</div>";
					str += "<div class='fontcol_right'>"+json.list[i].phone_code2+"</div>";
					str += "<div class='fontcol_center'><img src='images/icons_07.png' alt='情侣' class='fontcol_centerUp'><p class='lovers_p lovers_f1'>"+areas[_index][1]+"</p></div>";
					str += "</div>";
				} else{

					if(json.list[i].phone_fee == 0)json.list[i].phone_fee = 100; //预存最低100
					var str = "";
					str += "<div class='button_yuan button_margin' onclick=choose_phone("+json.list[i].phone_code+",'"+json.list[i].area_code+"','"+json.list[i].phone_id+"','"+json.list[i].phone_fee+"','"+json.list[i].minConsumption+"','"+json.list[i].lowestFee+"')>";
					
					//str += "<span class='fontcol div_margin'>"+json.list[i].phone_code+"</span>";
					if(0 == 0)
					{
						str += "<span class='fontcol div_margin'>"+get_c_code(json.list[i].phone_code,input_num)+"</span>";
					}
					else
					{
						str += "<span class='fontcol div_margin'>"+json.list[i].phone_code+"</span>";
					}
					//if(0 == 0)
					//{
					str += "<span class='fontcol div_margin'>预存话费"+json.list[i].phone_fee+"元</span><a class='fontcol div_margin'>"+json.list[i].area_name+"</a>";
					//}
					str += "</div>";
				}
				$("#phone_list").append(str);
			}
		}
	});
}

//获取上一页列表
function goto_pre()
{
	if(g_page > 1)
	{
		g_page = g_page - 1;
		g_next = true;
		get_list();
	}
}
//获取下一页列表
function goto_next()
{
	if(g_next)
	{
		g_page = g_page + 1;
		get_list();
	}
}
//选择靓号跳转
function choose_phone(phone_code,area,mobileId,startCost,minConsumption,lowestFee)
{
	//联通订单同步接口
	$.getJSON("ajax/checkMobile.php",{uid:1,phone_code:phone_code,startCost:startCost,minConsumption:minConsumption,lowestFee:lowestFee},
	function (json){
		if(json.err == "1")
		{
			Uconfirm(json.errinfo);
			return false;
		}
		else
		{
			location.href='info1.php?uid=1&domain=.&appkey=dm&phone_code='+phone_code+'&type=0&uuid='+json.uuid+'&mobileId='+mobileId+'&area='+area;
			//location.href='info1.php?uid=1&phone_code='+phone_code+'&type='+0;
		}
	});
	//location.href='info1.php?uid=1&phone_code='+phone_code+'&type=0&area='+area;
}


//check_show1("showshow"+_index);

//改变号码颜色
function get_c_code(code,num)
{
	if(num.indexOf("}") > 0 )
	{
		var arr=num.split("}{");
		arr[0] = arr[0].substr(1,1);
		var ostr = "";
		for(var j in arr)
		{
			ostr += parseInt(arr[j]);
		}
	}
	else
	{
		var ostr = num;
	}
	var str = "";
	//str = code.replace(ostr,"<span style='color:red;'>"+ostr+"</span>");
	//Uconfirm(code);
	var arr2=code.split(ostr);
	str = arr2[0];
	for(var i = 1;i<arr2.length;i++)
	{
		//Uconfirm(arr2[i]);
		str += "<span style='color:red;'>"+ostr+"</span>"+arr2[i];
	}
	/*if(arr2[1] != undefined)
	{
	str += arr2[1];
	}*/

	return str;
}


	   </script>


